import itchat
import time


@itchat.msg_register(itchat.content.TEXT, isGroupChat=True)
def quick_answer(msg):
    if msg.User.NickName == "132画饼团队":
        # breakpoint()
        msg_text = msg.text
        answer = None
        if all(tuple(key in msg_text for key in ["起源", "台球", "国家"])):
            answer = "英国"
        if all(tuple(key in msg_text for key in ["国际官方公认", "台球", "运动"])):
            answer = "斯诺克"
        if all(tuple(key in msg_text for key in ["魅支星", "公杆", "品牌"])):
            answer = "班恩"
        if all(tuple(key in msg_text for key in ["魅支星", "主打", "球台"])):
            answer = "乔氏"
        if all(tuple(key in msg_text for key in ["魅支星", "成立时间"])):
            answer = "2019"
        if all(tuple(key in msg_text for key in ["中式黑八", "几个", "口"])):
            answer = "6"
        if all(tuple(key in msg_text for key in ["中式黑八", "白球", "颗"])):
            answer = "16"
        if all(tuple(key in msg_text for key in ["星", "锐", "球帮", "库"])):
            answer = "钢库"
        if all(tuple(key in msg_text for key in ["星", "锐", "袋口", "尺寸"])):
            answer = "8.5cm"
        if all(tuple(key in msg_text for key in ["枫木", "白蜡木", "弹性", "好"])):
            answer = "枫木"
        if all(tuple(key in msg_text for key in ["斯洛克", "黑球", "分"])):
            answer = "7"
        if all(tuple(key in msg_text for key in ["斯洛克", "黄球", "分"])):
            answer = "2"
        if all(tuple(key in msg_text for key in ["中式黑八", "开球", "有效"])):
            answer = "四球碰库边"
        if all(tuple(key in msg_text for key in ["美式球杆", "杆头", "直径"])):
            answer = "13毫米"
        if all(tuple(key in msg_text for key in ["完全贴死", "白球"])):
            answer = "可以"
        if all(tuple(key in msg_text for key in ["弧线球", "犯规"])):
            answer = "不算"
        if all(tuple(key in msg_text for key in ["跳球", "母球二分之一以下"])):
            answer = "算"
        if all(tuple(key in msg_text for key in ["同时击中", "犯规"])):
            answer = "不算"
        if answer is not None:
            time.sleep(0.5)
            itchat.send_msg(answer, toUserName=msg.User.UserName)
    





itchat.auto_login(hotReload=True)
itchat.run()